package com.dkf;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dkf.mapper.SaleplanparaMapper;
import com.lww.springcloudapi.entity.TabSaleplanpara;
import com.lww.springcloudapi.result.Result;
import lombok.val;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

@MapperScan("com.dkf.mapper")
@RunWith(SpringRunner.class)
@SpringBootTest
public class Test01 {
    @Autowired

    private SaleplanparaMapper mapper;
    @Test
    public void ii(){
        System.out.println();
    }
    @Test
    public void cc(){
        QueryWrapper<TabSaleplanpara> wrapper = new QueryWrapper<>();
        //按有效期查询活动
        if(true){
            wrapper.ge("EXPDATE",new Date());
            wrapper.le("EFFDATE",new Date());
        }
        //分页
        val result = mapper.selectList(wrapper);
        System.out.println(Result.ok(result));
    }
}
